<?php
		require('config.php');
		$user_id=$_REQUEST['user_id'];
		//$user_id=1;
		$sql="select * from `".$oto."_user_address` where `userId`='".$user_id."' and `isDefault`='1'";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$user_address[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($user_address))
		{
			$sql="select * from `".$oto."_areas` where `areaId`='".$user_address[0]['areaId1']."'";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$sheng_info[]=$row;//将取得的所有数据赋值给person_info数组
			}
			$sql="select * from `".$oto."_areas` where `areaId`='".$user_address[0]['areaId2']."'";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$shi_info[]=$row;//将取得的所有数据赋值给person_info数组
			}
			$sql="select * from `".$oto."_areas` where `areaId`='".$user_address[0]['areaId3']."'";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$qu_info[]=$row;//将取得的所有数据赋值给person_info数组
			}
			$sql="select * from `".$oto."_communitys` where `communityId`='".$user_address[0]['communityId']."'";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$shequ_info[]=$row;//将取得的所有数据赋值给person_info数组
			}
			$user_address[0]['areaName1']=$sheng_info[0]['areaName'];
			$user_address[0]['areaName2']=$shi_info[0]['areaName'];
			$user_address[0]['areaName3']=$qu_info[0]['areaName'];
			$user_address[0]['communityName']=$shequ_info[0]['communityName'];
			$user_address[0]['address_default']=$sheng_info[0]['areaName'].$shi_info[0]['areaName'].=$qu_info[0]['areaName'].$shequ_info[0]['communityName'].$user_address[0]['address'];
		}
		echo json_encode($user_address);
?>